<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>NBCD Instruction</title>
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1 class="heading">NBCD Instruction<BR>
</h1>
<hr noshade></h1>
        <BR>
        <span class="text">The instruction NBCD (Negate BCD) negates a BCD-number. The method used for tens complement. The tens complement to 01 is 99 (1+99=100), to 26 is 74 (26+74=100) and so on. The X flag is added to the tens complement which is the loan from the previous BCD calculation (multi-precision). A normal series of BCD instructions starts with the X flag cleared and the Z flag set.<BR>
        <BR>
ADDRESS METHODS: Dn, (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l<BR>
        <BR>
DATA LENGTH: Byte</span></P>
        <TABLE border=0 cellPadding=0 cellSpacing=0 width="68%">
          <TBODY>
            <TR>
              <TD width="13%" rowSpan=5 vAlign=top class="text">FLAGS: </TD>
              <TD width="87%" class="text">X - Set if a loan was required when subtracting, else cleared</TD>
            </TR>
            <TR>
              <TD width="87%" class="text">N - undef</TD>
            </TR>
            <TR>
              <TD width="87%" class="text">Z - Cleared if the result was 0, else unaffected</TD>
            </TR>
            <TR>
              <TD width="87%" class="text">C - Same as X</TD>
            </TR>
            <TR>
              <TD width="87%" class="text">V - undef</TD>
            </TR>
          </TBODY>
        </TABLE>
        <P align=left><span class="text">SYNTAX: NBCD &lt;ea&gt;<BR>
        </span></P>
<span class="text">
  </span>
<P align=left><span class="text"><strong style="font-weight: 400">EXAMPLE CODE:</strong></span></P>
<P align=left class="sourcecode"><strong style="font-weight: 400">
<font face="Arial" size="2">&nbsp;&nbsp; NBCD.B&nbsp;&nbsp;&nbsp; D0&nbsp;&nbsp;&nbsp; 
 
Negates the BCD number in D0</font></strong></P>
</body>
</html>